/**
 *
 *  基础类，暴露静态单例方法
 *
 */
class BaseClass {
    /**
     * 构造函数
     */  
	public constructor() {
        Log.d(egret.getQualifiedClassName(this)+":Instance Create");
	}
	
	/**
	 * 获取一个单例
	 */ 
    public static getInstance(...args:any[]):any{
        var clazz:any = this;
        //如果匿名实例未被定义，开始构建匿名实例
        if(!clazz.instance){
            var argLength:number = args.length;
            switch(argLength){
                case 0:
                    clazz.instance = new clazz();
                    break;
                case 1:
                    clazz.instance = new clazz(args[0]);
                    break;
                case 2:
                    clazz.instance = new clazz(args[0],args[1]);
                    break;
                case 3:
                    clazz.instance = new clazz(args[0],args[1],args[2]);
                    break;
                case 4:
                    clazz.instance = new clazz(args[0],args[1],args[2],args[3]);
                    break;
            }
        }
        return clazz.instance;
    }
	
}
